<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>继承p的stu子类</title>
	</head>
	<body>
		<script type="text/javascript">
			function P(name,chinese,math){
			this.name=name;
			this.chinese=chinese;
			this.math=math;
			}
			P.prototype.name=function(){
			return name;
		}
			P.prototype.chinese=function(){
			return chinese;
		}
			P.prototype.math=function(){
			return math;
		}
			function stu(age){
				this.age=age;
			}
			P.prototype.age=function(){
			return chinese;
		}
			stu.prototype=new P("张三","80","90");
			var atu1=new stu("18");
				document.write("姓名："+atu1.name+"<br/>语文："+atu1.chinese+"<br/>数学："+atu1.math+"<br/>年龄："+atu1.age);
				
		</script>
	</body>
</html>
